package com.ly.heart.service;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ly.common.core.domain.AjaxResult;
import com.ly.heart.domain.MaterialDetailEntity;
import com.ly.heart.domain.SaleOrderEntity;
import com.ly.heart.domain.dto.CheckSaleMarkedPriceDto;
import com.ly.heart.domain.dto.SaleOrderAddDto;
import com.ly.heart.domain.dto.SaleOrderQueryDto;
import com.ly.heart.domain.vo.*;

/**
 * 销售订单Service接口
 * @author wutao
 * @date 2024-06-26
 */
public interface ISaleOrderService extends IService<SaleOrderEntity> {


    /**
     * 查询销售订单列表
     * @param saleOrderQueryDto
     * @return
     */
    IPage<SaleOrderDetailVo> selectSaleOrderDetailList (SaleOrderQueryDto saleOrderQueryDto);


    IPage<SaleOrderDetailVo> selectSaleOrderDetailListNew (SaleOrderQueryDto saleOrderQueryDto);

    /**
     * 查询销售订单
     * @param id 销售订单ID
     * @return 销售订单
     */
    public SaleOrderEntity selectSaleOrderById (String id);

    /**
     * 查询销售订单列表
     * @param saleOrder 销售订单
     * @return 销售订单集合
     */
    public List<SaleOrderEntity> selectSaleOrderList (SaleOrderEntity saleOrder);

    /**
     * 新增销售订单
     *
     * @param saleOrderAddDto 销售订单
     * @return 结果
     */
//    public AjaxResult insertSaleOrder(SaleOrderAddDto saleOrderAddDto);

    /**
     * 修改销售订单
     * @param saleOrder 销售订单
     * @return 结果
     */
    public AjaxResult updateSaleOrder (SaleOrderAddDto saleOrderAddDto);


    public boolean approvedSaleOrder (SaleOrderEntity saleOrderEntity);

    /**
     * 批量删除销售订单
     * @param ids 需要删除的销售订单ID
     * @return 结果
     */
    public int deleteSaleOrderByIds (String[] ids);

    /**
     * 删除销售订单信息
     * @param id 销售订单ID
     * @return 结果
     */
    public int deleteSaleOrderById (String id);

    public AjaxResult queryOrderDetailList (SaleOrderQueryDto saleOrderQueryDto);


    /**
     * 根据采购合同对象List查询物料明细
     * @return
     */
    List<ContractOrderMaterialDetailVo> queryMaterial ();

    /**
     * 检查销售订单价格是否正确
     * @param checkSaleMarkedPriceDto
     * @return
     */

    public List<MaterialDetailEntity> checkSaleOrderDetailByPriceInfo (CheckSaleMarkedPriceDto checkSaleMarkedPriceDto);

    /**
     * 查询销售订单变更
     * @param queryDto
     * @return
     */
    IPage<SaleOrderChangeVo> selectSaleOrderChangeListByMaterial (SaleOrderQueryDto queryDto);


    AjaxResult draft (SaleOrderAddDto saleOrderAddDto);

    AjaxResult submit (SaleOrderAddDto saleOrderAddDto);


    /**
     * 根据Id查询销售订单推送金蝶
     * @param id
     * @return
     */
    SaleOrderCodeVo getSaleCodeById ( String id);

}
